UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qstk4WPVyZTb7tPMoREyIGYjEsEpfK42iJxhkdiZ5ms=' 
WHERE 
  key_id = 'a906812ebd6f534c3f3f0aa5d6fdff6b4106708828cba9c2a0127950eddb9dc0' 
  AND (
    token = 'Qstk4WPVyZTb7tPMoREyIGYjEsEpfK42iJxhkdiZ5ms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033