UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hWUVZtC4WEEHLo4WU/qY0SkkCz1Ox5ifjf1zxo3IOQE='
WHERE
key_id = 'f43e7c6e61c28ce213a07ddaab4682c742caa8576ced7b3a00a84224e0e766e8'
AND (
token = 'hWUVZtC4WEEHLo4WU/qY0SkkCz1Ox5ifjf1zxo3IOQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)