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