UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9LVf6/Pp1S7Ivpy89CU5D4itU6m/oI8zf69lJTY4WyI='
WHERE
key_id = 'edd3fc1aa00108b6c97becfe24e1270c6b05bc63ac8c6da93bd90bef96fa7ef9'
AND (
token = '9LVf6/Pp1S7Ivpy89CU5D4itU6m/oI8zf69lJTY4WyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)