UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xtjvSxbgOwq/mabSFfrab4O84DXvC5o3i32coxNLjes=' 
WHERE 
  key_id = 'bc19bc165a01c92d07766d2a62ff68792009ff2ac3888fdb9651f3b231bb0a33' 
  AND (
    token = 'xtjvSxbgOwq/mabSFfrab4O84DXvC5o3i32coxNLjes=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027