UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HzM76TYxoj7EEcP1oKIBq9QdYyi+2Rmscg9HwGy5l9s='
WHERE
key_id = '4ee66e1b98dcf683fd805e232bc06f6ff55bac39a142957dc11eea709a80c764'
AND (
token = 'HzM76TYxoj7EEcP1oKIBq9QdYyi+2Rmscg9HwGy5l9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)