UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '17kT8MtKev9tiqGik0W02u65BUooniFmd9Ur2swvfSQ='
WHERE
key_id = '150f5d28ccf6d5936ba72568b30100841f45555c06ca50d4aedf4f4a44394c1e'
AND (
token = '17kT8MtKev9tiqGik0W02u65BUooniFmd9Ur2swvfSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)