UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gBwQ7KUUwR3lFFJzKpVlQbP/xoFlwOwyzV1wHsXNuN4=' 
WHERE 
  key_id = 'd9fe72875eb3998fb59ff38ac675a43a871dcd20c7a42b2a20526651245224c2' 
  AND (
    token = 'gBwQ7KUUwR3lFFJzKpVlQbP/xoFlwOwyzV1wHsXNuN4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029