UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7i2USpwUs6/yGf4JaoznwN+chRRWsDIdDquvfWvHfE4=' 
WHERE 
  key_id = '45a3c3b5020344cadf7b37c15175918432063733a7c33131bc426a5dc2e4c03a' 
  AND (
    token = '7i2USpwUs6/yGf4JaoznwN+chRRWsDIdDquvfWvHfE4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037