UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Jd14RO1u0E9KeYsur3mu62IuKqI8lVTDNIVFvTys80='
WHERE
key_id = '3ce3cb8a7681825a5d9394ce4f0b66e39f375455ee25073365fcc6613ba9424e'
AND (
token = '7Jd14RO1u0E9KeYsur3mu62IuKqI8lVTDNIVFvTys80='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)