UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fuKYPCSG6zVBLSVZuv+do4DiXWFSnCJK1tpybirYNpM=' 
WHERE 
  key_id = '105b93956115dab4509c93639f9b872856090c39d045501af5346c12cf0169a0' 
  AND (
    token = 'fuKYPCSG6zVBLSVZuv+do4DiXWFSnCJK1tpybirYNpM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046