UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J3RGRTF+DqbNv9OiXYwGSie0OMzjGKBlPtVdfXdgBoU='
WHERE
key_id = '5f489252d26c9c5c447bcd695b902b33d64847905040b6372b84bdea648ecbac'
AND (
token = 'J3RGRTF+DqbNv9OiXYwGSie0OMzjGKBlPtVdfXdgBoU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)