UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oLjX03Alz5Vl2vfIKZNSzup9/hp4yGhwdANTzBJxkuc=' 
WHERE 
  key_id = 'edf80023bc98f9e62da58dcbf05f8835075e96490b007d752133a67f009efa54' 
  AND (
    token = 'oLjX03Alz5Vl2vfIKZNSzup9/hp4yGhwdANTzBJxkuc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038