UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yaIB9hoPu6gJyA/jv4Fsm3dnBMuHGtXe4CnzerH4+O8=' 
WHERE 
  key_id = '7d3af9414bf97ef73950dd78787fe69a21a0b983afb2d6b8e12e1f91eeb96a4f' 
  AND (
    token = 'yaIB9hoPu6gJyA/jv4Fsm3dnBMuHGtXe4CnzerH4+O8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029