UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5be97yNNpo2XyYNtzSj5lSrU38C89+fQ9buLPVkLNH0=' 
WHERE 
  key_id = '61b997a1ab06eb7e2f9b5988814e7ddd9600d6de244415a553fdd94476bec7a4' 
  AND (
    token = '5be97yNNpo2XyYNtzSj5lSrU38C89+fQ9buLPVkLNH0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020