UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nv3heLf60SLu+i/f7vsxHHH0W2olR1jnibCB3Bk49AU=' 
WHERE 
  key_id = '25aeff92ee0ff6a22131fc7ac57bbe175371f1a6e72323d59c49449d0bf74b6a' 
  AND (
    token = 'nv3heLf60SLu+i/f7vsxHHH0W2olR1jnibCB3Bk49AU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031