UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vcP8ecutQVkaI5/ENsJ5VPphlYrCMhGkIfRLLHmSzwo='
WHERE
key_id = '2fdf769edca8a9ebe4fe6a12b2c112d0346edc1f3cddb76345b7eb6da8989ba9'
AND (
token = 'vcP8ecutQVkaI5/ENsJ5VPphlYrCMhGkIfRLLHmSzwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)