UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bfGOlUODGYQU5RZ93z2jDIFkq+Z/jMmc9R1q/6gvQI8='
WHERE
key_id = '7936b24585f251d2aff3087673593c3f27d28b959697df6031560d28c389a1ff'
AND (
token = 'bfGOlUODGYQU5RZ93z2jDIFkq+Z/jMmc9R1q/6gvQI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)