UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WToA2iupteER4V3E22zJYW0uCEOmxjvEJuf5aCgvARU='
WHERE
key_id = '1948fa4e20c8fb22febd322d8f273eb6c478421d096348a03204200e43211271'
AND (
token = 'WToA2iupteER4V3E22zJYW0uCEOmxjvEJuf5aCgvARU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)