UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yla1tkHbhAUxDElMrOa26vafOTVqPwyS5QO+sXv5698='
WHERE
key_id = 'fd56c058df648de1bbc30d2504f6bdf32f63a5e241d2fe68a72c928028990352'
AND (
token = 'Yla1tkHbhAUxDElMrOa26vafOTVqPwyS5QO+sXv5698='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)