UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e1/oRFRXCilT/kHAF9KwjRt4wZamf2riC6YMU6RQpwY=' 
WHERE 
  key_id = '663fc7c638ea01e4bf7db52c80acdcc0780bda0878634be1843b591c699acaba' 
  AND (
    token = 'e1/oRFRXCilT/kHAF9KwjRt4wZamf2riC6YMU6RQpwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026