UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xqPhD+gOY/MxEBInI+qSXL6o7vtcbHHOShHEE4OHPq8='
WHERE
key_id = '282895d5d28b10ec8bd3bea211eccebe623c50711aa6e10f149dbde12dbbb3bc'
AND (
token = 'xqPhD+gOY/MxEBInI+qSXL6o7vtcbHHOShHEE4OHPq8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)