UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F1+Ket9PNNz5OG0L3ZrZjd29zDsG2kuRkeP/1Vko/GM=' 
WHERE 
  key_id = '5204cf4b55003407cb66eb8591ce049763d8dd4eab360edbaacacb20bfa15fe5' 
  AND (
    token = 'F1+Ket9PNNz5OG0L3ZrZjd29zDsG2kuRkeP/1Vko/GM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021