UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aocs6p2lArntjvX4R74YKCi4TFzKd+91BPixxV7IKts='
WHERE
key_id = 'fc3ff3de9b0a328e1b908fa5646c4c6b7d037a60bdc0c72aa81a03eaded24a5f'
AND (
token = 'aocs6p2lArntjvX4R74YKCi4TFzKd+91BPixxV7IKts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)