UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7A7MU2UT8A/9vEtuz3O5XVl/U/+yQIGvjVtYcGeaY4k=' 
WHERE 
  key_id = '9f9f501cfb6085f17ce4a80d6634932c295ffcc9aaaf84b2698a4af6a1ec5f0f' 
  AND (
    token = '7A7MU2UT8A/9vEtuz3O5XVl/U/+yQIGvjVtYcGeaY4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045