UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RRy1CbvMM+DGDeFY6ESIgPZ2fjI8EP9VJ21d2Tv1B2Q=' 
WHERE 
  key_id = 'aac7a6a256e4bc97e4aafe38e746dc8e22fdade21edcf0fc5531edbe8e0dec34' 
  AND (
    token = 'RRy1CbvMM+DGDeFY6ESIgPZ2fjI8EP9VJ21d2Tv1B2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032