UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dldH9h5WF6cj4x5aDSEiS875kCkr+YvcuSCBX0iZZOs='
WHERE
key_id = 'b9b62963823b6d5655e2d2121364d764678e18a623b79a2cee2f07c11d217c9b'
AND (
token = 'dldH9h5WF6cj4x5aDSEiS875kCkr+YvcuSCBX0iZZOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)