UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9XG7syO9zpgcAEiEPUTNfY7blDyPedpP4w2XGmFlVTE=' 
WHERE 
  key_id = 'adfdc63647a4971f71a0b32be7c0a3759d01174edc38a3a6364baacae917f236' 
  AND (
    token = '9XG7syO9zpgcAEiEPUTNfY7blDyPedpP4w2XGmFlVTE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046