UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pzl7lraSgPUyx32itNhO0VgndHXCTQconuwwFjBSRMQ=' 
WHERE 
  key_id = '9fff4a0201ad95f8b685552d2583f85f76f9ca5a37d76d9a840b664182b97e23' 
  AND (
    token = 'Pzl7lraSgPUyx32itNhO0VgndHXCTQconuwwFjBSRMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031