UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WiFJevuMROpOx3hnBCeJse5rhPGi51jIydD95HcHeJQ='
WHERE
key_id = 'ebdbd3b4b02b3a1bbfa351a8f54c2866d6bbdc94bf102231a980ebcae4d979ef'
AND (
token = 'WiFJevuMROpOx3hnBCeJse5rhPGi51jIydD95HcHeJQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)